<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>群组列表 - 社交圈</title>
    <!-- Bootstrap 5 CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome 图标 -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/css/all.min.css">
    
    <style>
        :root {
            --primary: #3b82f6;
            --primary-light: #60a5fa;
            --primary-dark: #2563eb;
            --secondary: #8b5cf6;
            --success: #10b981;
            --warning: #f59e0b;
            --danger: #ef4444;
            --text-primary: #1e293b;
            --text-secondary: #64748b;
            --text-tertiary: #94a3b8;
            --bg-light: #f8fafc;
            --bg-white: #ffffff;
            --bg-secondary: #f1f5f9;
            --border-light: #e2e8f0;
            --border-medium: #cbd5e1;
            --radius: 12px;
            --radius-sm: 8px;
            --shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
        }
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
            background-color: var(--bg-light);
            color: var(--text-primary);
            padding-top: 56px;
            padding-bottom: 60px;
        }
        
        /* 顶部导航 */
        .top-nav {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            height: 56px;
            background-color: var(--bg-white);
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 16px;
            z-index: 1000;
            border-bottom: 1px solid var(--border-light);
        }
        
        .nav-title {
            font-size: 1.1rem;
            font-weight: 600;
        }
        
        .nav-action {
            color: var(--text-secondary);
            background: none;
            border: none;
            font-size: 1.2rem;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .nav-action:hover {
            background-color: var(--bg-light);
        }
        
        .nav-action.primary {
            color: var(--primary);
        }
        
        /* 搜索和筛选区域 */
        .search-filter-container {
            padding: 12px 16px;
            background-color: var(--bg-light);
            border-bottom: 1px solid var(--border-light);
        }
        
        .search-bar {
            margin-bottom: 12px;
        }
        
        .search-input-group {
            position: relative;
        }
        
        .search-input {
            width: 100%;
            padding: 10px 16px 10px 40px;
            border-radius: 24px;
            border: 1px solid var(--border-light);
            background-color: var(--bg-white);
            font-size: 0.9rem;
            outline: none;
        }
        
        .search-icon {
            position: absolute;
            left: 14px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-tertiary);
        }
        
        /* 筛选工具栏 */
        .filter-toolbar {
            display: flex;
            gap: 8px;
            overflow-x: auto;
            padding-bottom: 4px;
            scrollbar-width: none;
        }
        
        .filter-toolbar::-webkit-scrollbar {
            display: none;
        }
        
        .filter-btn {
            padding: 6px 14px;
            border-radius: 18px;
            font-size: 0.85rem;
            white-space: nowrap;
            background-color: var(--bg-white);
            border: 1px solid var(--border-light);
            color: var(--text-secondary);
            display: flex;
            align-items: center;
            gap: 6px;
        }
        
        .filter-btn.active {
            background-color: var(--primary);
            color: white;
            border-color: var(--primary);
        }
        
        .filter-btn i {
            font-size: 0.9rem;
        }
        
        /* 高级筛选面板 */
        .advanced-filter-panel {
            background-color: var(--bg-white);
            border-radius: var(--radius);
            padding: 16px;
            margin: 12px 16px;
            box-shadow: var(--shadow);
        }
        
        .filter-section {
            margin-bottom: 16px;
        }
        
        .filter-section:last-child {
            margin-bottom: 0;
        }
        
        .filter-section-title {
            font-size: 0.95rem;
            font-weight: 600;
            margin-bottom: 10px;
            color: var(--text-primary);
        }
        
        .filter-options {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }
        
        .filter-option {
            padding: 6px 12px;
            border-radius: 16px;
            font-size: 0.8rem;
            background-color: var(--bg-light);
            color: var(--text-secondary);
            cursor: pointer;
            transition: all 0.2s;
        }
        
        .filter-option.active {
            background-color: var(--primary-light);
            color: var(--primary-dark);
        }
        
        .filter-actions {
            display: flex;
            justify-content: flex-end;
            gap: 10px;
            margin-top: 12px;
            padding-top: 12px;
            border-top: 1px solid var(--border-light);
        }
        
        .filter-action-btn {
            padding: 6px 16px;
            border-radius: 18px;
            font-size: 0.9rem;
            border: none;
            cursor: pointer;
        }
        
        .reset-btn {
            background-color: var(--bg-light);
            color: var(--text-secondary);
        }
        
        .apply-btn {
            background-color: var(--primary);
            color: white;
        }
        
        /* 筛选结果统计 */
        .filter-results {
            padding: 12px 16px;
            font-size: 0.85rem;
            color: var(--text-secondary);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .sort-selector {
            display: flex;
            align-items: center;
            gap: 6px;
            color: var(--text-primary);
            font-size: 0.85rem;
        }
        
        .sort-select {
            border: none;
            background: transparent;
            color: var(--primary);
            font-weight: 500;
            padding: 2px;
            outline: none;
        }
        
        /* 主要内容区域 */
        .content-container {
            padding: 0 16px;
        }
        
        /* 分类标题 */
        .groups-category {
            font-size: 1.1rem;
            font-weight: 600;
            margin: 24px 0 16px;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .groups-category i {
            color: var(--primary);
        }
        
        /* 视图切换 */
        .view-toggle {
            display: flex;
            gap: 8px;
            margin-bottom: 16px;
        }
        
        .view-btn {
            width: 36px;
            height: 36px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            background-color: var(--bg-white);
            border: 1px solid var(--border-light);
            color: var(--text-secondary);
        }
        
        .view-btn.active {
            background-color: var(--primary);
            color: white;
            border-color: var(--primary);
        }
        
        /* 1. 列表式群组 */
        .list-groups {
            margin-bottom: 24px;
        }
        
        .list-group-item {
            display: flex;
            align-items: center;
            padding: 12px 0;
            border-bottom: 1px solid var(--border-light);
            text-decoration: none;
            color: var(--text-primary);
        }
        
        .list-group-item:last-child {
            border-bottom: none;
        }
        
        .group-avatar {
            width: 56px;
            height: 56px;
            border-radius: 10px;
            background-color: var(--bg-secondary);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
            color: var(--primary);
            margin-right: 14px;
            flex-shrink: 0;
        }
        
        .group-avatar img {
            width: 100%;
            height: 100%;
            border-radius: 10px;
            object-fit: cover;
        }
        
        .group-info {
            flex: 1;
            min-width: 0;
        }
        
        .group-name {
            font-weight: 600;
            margin-bottom: 2px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        
        .group-meta {
            display: flex;
            align-items: center;
            font-size: 0.8rem;
            color: var(--text-secondary);
        }
        
        .group-member-count {
            display: flex;
            align-items: center;
            margin-right: 12px;
        }
        
        .group-member-count i {
            font-size: 0.75rem;
            margin-right: 4px;
        }
        
        .group-category {
            background-color: var(--bg-secondary);
            padding: 2px 8px;
            border-radius: 10px;
            font-size: 0.75rem;
        }
        
        .group-arrow {
            color: var(--text-tertiary);
            font-size: 1rem;
        }
        
        /* 2. 带预览图的群组列表 */
        .preview-groups {
            margin-bottom: 24px;
        }
        
        .preview-group-item {
            display: flex;
            padding: 12px 0;
            border-bottom: 1px solid var(--border-light);
            text-decoration: none;
            color: var(--text-primary);
        }
        
        .preview-group-item:last-child {
            border-bottom: none;
        }
        
        .preview-group-info {
            flex: 1;
            margin-right: 12px;
            min-width: 0;
        }
        
        .preview-group-name {
            font-weight: 600;
            margin-bottom: 6px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        
        .preview-group-desc {
            font-size: 0.8rem;
            color: var(--text-secondary);
            margin-bottom: 8px;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }
        
        .preview-group-stats {
            display: flex;
            align-items: center;
            font-size: 0.75rem;
            color: var(--text-tertiary);
        }
        
        .preview-group-media {
            width: 80px;
            height: 80px;
            border-radius: var(--radius-sm);
            overflow: hidden;
            flex-shrink: 0;
            position: relative;
        }
        
        .group-single-image {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        .group-multi-images {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            grid-template-rows: repeat(2, 1fr);
            gap: 2px;
            width: 100%;
            height: 100%;
        }
        
        .group-multi-images img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        .no-image-placeholder {
            width: 100%;
            height: 100%;
            background-color: var(--bg-secondary);
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text-tertiary);
            font-size: 1.5rem;
        }
        
        /* 3. 卡片式群组展示 */
        .card-groups {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 16px;
            margin-bottom: 24px;
        }
        
        .card-group-item {
            background-color: var(--bg-white);
            border-radius: var(--radius);
            overflow: hidden;
            box-shadow: var(--shadow);
            text-decoration: none;
            color: var(--text-primary);
        }
        
        .card-group-media {
            width: 100%;
            height: 100px;
            position: relative;
        }
        
        .card-group-media img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        .card-group-avatar {
            width: 36px;
            height: 36px;
            border-radius: 8px;
            background-color: var(--bg-secondary);
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--primary);
            font-size: 1rem;
            position: absolute;
            bottom: -18px;
            left: 12px;
            border: 3px solid var(--bg-white);
        }
        
        .card-group-avatar img {
            width: 100%;
            height: 100%;
            border-radius: 6px;
            object-fit: cover;
        }
        
        .card-group-content {
            padding: 24px 12px 12px;
        }
        
        .card-group-name {
            font-weight: 600;
            font-size: 0.9rem;
            margin-bottom: 4px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        
        .card-group-meta {
            display: flex;
            align-items: center;
            font-size: 0.75rem;
            color: var(--text-secondary);
        }
        
        /* 底部导航 */
        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            height: 60px;
            background-color: var(--bg-white);
            display: flex;
            justify-content: space-around;
            align-items: center;
            border-top: 1px solid var(--border-light);
            z-index: 1000;
        }
        
        .nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            color: var(--text-secondary);
            font-size: 0.7rem;
            gap: 4px;
            flex: 1;
            height: 100%;
            text-decoration: none;
        }
        
        .nav-item.active {
            color: var(--primary);
        }
        
        .nav-icon {
            font-size: 1.2rem;
        }
        
        /* 提示消息 */
        .toast {
            position: fixed;
            bottom: 80px;
            left: 50%;
            transform: translateX(-50%);
            background-color: rgba(0, 0, 0, 0.7);
            color: white;
            padding: 8px 16px;
            border-radius: 4px;
            z-index: 9999;
            font-size: 0.85rem;
            opacity: 0;
            transition: opacity 0.3s ease;
        }
        
        .toast.show {
            opacity: 1;
        }
        
        /* 创建群组按钮 */
        .create-group-btn {
            position: fixed;
            right: 24px;
            bottom: 84px;
            width: 56px;
            height: 56px;
            border-radius: 50%;
            background-color: var(--primary);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
            box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
            text-decoration: none;
            z-index: 999;
        }
        
        /* 空状态 */
        .empty-state {
            padding: 40px 20px;
            text-align: center;
            color: var(--text-tertiary);
        }
        
        .empty-icon {
            font-size: 3rem;
            margin-bottom: 16px;
            color: var(--border-medium);
        }
        
        .empty-text {
            margin-bottom: 24px;
        }
        
        .empty-action {
            background-color: var(--primary);
            color: white;
            border: none;
            padding: 8px 20px;
            border-radius: 20px;
            font-size: 0.9rem;
        }
        
        /* 加载更多 */
        .load-more {
            padding: 16px 0 32px;
            text-align: center;
        }
        
        .load-more-btn {
            background-color: var(--bg-white);
            border: 1px solid var(--border-light);
            color: var(--text-secondary);
            padding: 8px 24px;
            border-radius: 20px;
            font-size: 0.9rem;
            display: flex;
            align-items: center;
            gap: 8px;
            margin: 0 auto;
        }
    </style>
</head>
<body>
    <!-- 顶部导航 -->
    <div class="top-nav">
        <button class="nav-action" id="backBtn">
            <i class="fas fa-arrow-left"></i>
        </button>
        <div class="nav-title">群组</div>
        <button class="nav-action primary" id="groupSettingsBtn">
            <i class="fas fa-sliders"></i>
        </button>
    </div>
    
    <!-- 搜索和筛选区域 -->
    <div class="search-filter-container">
        <div class="search-bar">
            <div class="search-input-group">
                <i class="fas fa-search search-icon"></i>
                <input type="text" class="search-input" placeholder="搜索群组...">
            </div>
        </div>
        
        <div class="filter-toolbar">
            <button class="filter-btn active">
                <i class="fas fa-th"></i>
                <span>全部</span>
            </button>
            <button class="filter-btn">
                <i class="fas fa-user-check"></i>
                <span>已加入</span>
            </button>
            <button class="filter-btn">
                <i class="fas fa-star"></i>
                <span>推荐</span>
            </button>
            <button class="filter-btn">
                <i class="fas fa-fire"></i>
                <span>热门</span>
            </button>
            <button class="filter-btn">
                <i class="fas fa-clock"></i>
                <span>最新</span>
            </button>
            <button class="filter-btn" id="advancedFilterBtn">
                <i class="fas fa-filter"></i>
                <span>筛选</span>
            </button>
        </div>
    </div>
    
    <!-- 高级筛选面板 (默认隐藏) -->
    <div class="advanced-filter-panel" id="advancedFilterPanel" style="display: none;">
        <div class="filter-section">
            <div class="filter-section-title">群组分类</div>
            <div class="filter-options">
                <div class="filter-option active">全部</div>
                <div class="filter-option">兴趣爱好</div>
                <div class="filter-option">技术交流</div>
                <div class="filter-option">生活休闲</div>
                <div class="filter-option">文化艺术</div>
                <div class="filter-option">职场工作</div>
                <div class="filter-option">学习教育</div>
            </div>
        </div>
        
        <div class="filter-section">
            <div class="filter-section-title">成员数量</div>
            <div class="filter-options">
                <div class="filter-option active">全部</div>
                <div class="filter-option">100人以下</div>
                <div class="filter-option">100-500人</div>
                <div class="filter-option">500-1000人</div>
                <div class="filter-option">1000人以上</div>
            </div>
        </div>
        
        <div class="filter-section">
            <div class="filter-section-title">活跃度</div>
            <div class="filter-options">
                <div class="filter-option active">全部</div>
                <div class="filter-option">高</div>
                <div class="filter-option">中</div>
                <div class="filter-option">低</div>
            </div>
        </div>
        
        <div class="filter-actions">
            <button class="filter-action-btn reset-btn" id="resetFilterBtn">重置</button>
            <button class="filter-action-btn apply-btn" id="applyFilterBtn">应用筛选</button>
        </div>
    </div>
    
    <!-- 筛选结果统计 -->
    <div class="filter-results">
        <div>找到 24 个群组</div>
        <div class="sort-selector">
            <span>排序：</span>
            <select class="sort-select" id="sortSelect">
                <option value="recommend">推荐</option>
                <option value="hot">热门程度</option>
                <option value="newest">最新创建</option>
                <option value="members">成员数量</option>
            </select>
        </div>
    </div>
    
    <!-- 视图切换 -->
    <div class="content-container">
        <div class="view-toggle">
            <button class="view-btn active" data-view="list" title="列表视图">
                <i class="fas fa-list"></i>
            </button>
            <button class="view-btn" data-view="preview" title="图文视图">
                <i class="fas fa-th-list"></i>
            </button>
            <button class="view-btn" data-view="card" title="卡片视图">
                <i class="fas fa-th-large"></i>
            </button>
        </div>
    </div>
    
    <!-- 主要内容区域 -->
    <div class="content-container">
        <!-- 列表式群组 (默认显示) -->
        <div class="list-groups" id="listView">
            <!-- 有图片的群组 -->
            <a href="#" class="list-group-item">
                <div class="group-avatar">
                    <img src="https://picsum.photos/id/64/200/200" alt="摄影爱好者">
                </div>
                <div class="group-info">
                    <div class="group-name">摄影爱好者</div>
                    <div class="group-meta">
                        <div class="group-member-count">
                            <i class="fas fa-users"></i>
                            <span>2,451 成员</span>
                        </div>
                        <div class="group-category">兴趣爱好</div>
                    </div>
                </div>
                <i class="fas fa-chevron-right group-arrow"></i>
            </a>
            
            <!-- 无图片的群组 -->
            <a href="#" class="list-group-item">
                <div class="group-avatar">
                    <i class="fas fa-code"></i>
                </div>
                <div class="group-info">
                    <div class="group-name">前端开发者社区</div>
                    <div class="group-meta">
                        <div class="group-member-count">
                            <i class="fas fa-users"></i>
                            <span>8,732 成员</span>
                        </div>
                        <div class="group-category">技术交流</div>
                    </div>
                </div>
                <i class="fas fa-chevron-right group-arrow"></i>
            </a>
            
            <!-- 有图片的群组 -->
            <a href="#" class="list-group-item">
                <div class="group-avatar">
                    <img src="https://picsum.photos/id/42/200/200" alt="美食探店">
                </div>
                <div class="group-info">
                    <div class="group-name">美食探店分享</div>
                    <div class="group-meta">
                        <div class="group-member-count">
                            <i class="fas fa-users"></i>
                            <span>5,129 成员</span>
                        </div>
                        <div class="group-category">生活休闲</div>
                    </div>
                </div>
                <i class="fas fa-chevron-right group-arrow"></i>
            </a>
            
            <!-- 无图片的群组 -->
            <a href="#" class="list-group-item">
                <div class="group-avatar">
                    <i class="fas fa-book"></i>
                </div>
                <div class="group-info">
                    <div class="group-name">读书俱乐部</div>
                    <div class="group-meta">
                        <div class="group-member-count">
                            <i class="fas fa-users"></i>
                            <span>1,254 成员</span>
                        </div>
                        <div class="group-category">文化艺术</div>
                    </div>
                </div>
                <i class="fas fa-chevron-right group-arrow"></i>
            </a>
            
            <!-- 有图片的群组 -->
            <a href="#" class="list-group-item">
                <div class="group-avatar">
                    <img src="https://picsum.photos/id/26/200/200" alt="职场交流">
                </div>
                <div class="group-info">
                    <div class="group-name">职场经验交流</div>
                    <div class="group-meta">
                        <div class="group-member-count">
                            <i class="fas fa-users"></i>
                            <span>7,321 成员</span>
                        </div>
                        <div class="group-category">职场工作</div>
                    </div>
                </div>
                <i class="fas fa-chevron-right group-arrow"></i>
            </a>
        </div>
        
        <!-- 带预览图的群组列表 (默认隐藏) -->
        <div class="preview-groups" id="previewView" style="display: none;">
            <!-- 带单张图片的群组 -->
            <a href="#" class="preview-group-item">
                <div class="preview-group-info">
                    <div class="preview-group-name">摄影爱好者</div>
                    <div class="preview-group-desc">分享摄影技巧、作品展示和器材讨论，欢迎各类摄影爱好者加入</div>
                    <div class="preview-group-stats">
                        <div class="group-member-count">
                            <i class="fas fa-users"></i>
                            <span>2,451 成员</span>
                        </div>
                        <span>•</span>
                        <span>156 个话题/天</span>
                    </div>
                </div>
                <div class="preview-group-media">
                    <img src="https://picsum.photos/id/64/400/400" alt="摄影爱好者" class="group-single-image">
                </div>
            </a>
            
            <!-- 带多张图片的群组 -->
            <a href="#" class="preview-group-item">
                <div class="preview-group-info">
                    <div class="preview-group-name">前端开发者社区</div>
                    <div class="preview-group-desc">讨论HTML、CSS、JavaScript等前端技术，分享开发经验和行业动态</div>
                    <div class="preview-group-stats">
                        <div class="group-member-count">
                            <i class="fas fa-users"></i>
                            <span>8,732 成员</span>
                        </div>
                        <span>•</span>
                        <span>328 个话题/天</span>
                    </div>
                </div>
                <div class="preview-group-media">
                    <div class="group-multi-images">
                        <img src="https://picsum.photos/id/0/200/200" alt="技术分享1">
                        <img src="https://picsum.photos/id/1/200/200" alt="技术分享2">
                        <img src="https://picsum.photos/id/2/200/200" alt="技术分享3">
                        <img src="https://picsum.photos/id/3/200/200" alt="技术分享4">
                    </div>
                </div>
            </a>
            
            <!-- 无图片的群组 -->
            <a href="#" class="preview-group-item">
                <div class="preview-group-info">
                    <div class="preview-group-name">读书俱乐部</div>
                    <div class="preview-group-desc">分享阅读心得，推荐好书，组织线上读书讨论会</div>
                    <div class="preview-group-stats">
                        <div class="group-member-count">
                            <i class="fas fa-users"></i>
                            <span>1,254 成员</span>
                        </div>
                        <span>•</span>
                        <span>42 个话题/天</span>
                    </div>
                </div>
                <div class="preview-group-media">
                    <div class="no-image-placeholder">
                        <i class="fas fa-book"></i>
                    </div>
                </div>
            </a>
            
            <!-- 带单张图片的群组 -->
            <a href="#" class="preview-group-item">
                <div class="preview-group-info">
                    <div class="preview-group-name">美食探店分享</div>
                    <div class="preview-group-desc">发现各地美食，分享探店经验和美食制作方法</div>
                    <div class="preview-group-stats">
                        <div class="group-member-count">
                            <i class="fas fa-users"></i>
                            <span>5,129 成员</span>
                        </div>
                        <span>•</span>
                        <span>215 个话题/天</span>
                    </div>
                </div>
                <div class="preview-group-media">
                    <img src="https://picsum.photos/id/42/400/400" alt="美食探店" class="group-single-image">
                </div>
            </a>
        </div>
        
        <!-- 卡片式群组展示 (默认隐藏) -->
        <div class="card-groups" id="cardView" style="display: none;">
            <!-- 有图片的卡片式群组 -->
            <a href="#" class="card-group-item">
                <div class="card-group-media">
                    <img src="https://picsum.photos/id/64/400/300" alt="摄影爱好者">
                    <div class="card-group-avatar">
                        <img src="https://picsum.photos/id/64/100/100" alt="摄影爱好者">
                    </div>
                </div>
                <div class="card-group-content">
                    <div class="card-group-name">摄影爱好者</div>
                    <div class="card-group-meta">
                        <div class="group-member-count">
                            <i class="fas fa-users"></i>
                            <span>2,451 成员</span>
                        </div>
                        <span>•</span>
                        <span>兴趣爱好</span>
                    </div>
                </div>
            </a>
            
            <!-- 无图片的卡片式群组 -->
            <a href="#" class="card-group-item">
                <div class="card-group-media">
                    <div class="no-image-placeholder">
                        <i class="fas fa-code"></i>
                    </div>
                    <div class="card-group-avatar">
                        <i class="fas fa-code"></i>
                    </div>
                </div>
                <div class="card-group-content">
                    <div class="card-group-name">前端开发者社区</div>
                    <div class="card-group-meta">
                        <div class="group-member-count">
                            <i class="fas fa-users"></i>
                            <span>8,732 成员</span>
                        </div>
                        <span>•</span>
                        <span>技术交流</span>
                    </div>
                </div>
            </a>
            
            <!-- 有图片的卡片式群组 -->
            <a href="#" class="card-group-item">
                <div class="card-group-media">
                    <img src="https://picsum.photos/id/42/400/300" alt="美食探店">
                    <div class="card-group-avatar">
                        <img src="https://picsum.photos/id/42/100/100" alt="美食探店">
                    </div>
                </div>
                <div class="card-group-content">
                    <div class="card-group-name">美食探店分享</div>
                    <div class="card-group-meta">
                        <div class="group-member-count">
                            <i class="fas fa-users"></i>
                            <span>5,129 成员</span>
                        </div>
                        <span>•</span>
                        <span>生活休闲</span>
                    </div>
                </div>
            </a>
            
            <!-- 无图片的卡片式群组 -->
            <a href="#" class="card-group-item">
                <div class="card-group-media">
                    <div class="no-image-placeholder">
                        <i class="fas fa-book"></i>
                    </div>
                    <div class="card-group-avatar">
                        <i class="fas fa-book"></i>
                    </div>
                </div>
                <div class="card-group-content">
                    <div class="card-group-name">读书俱乐部</div>
                    <div class="card-group-meta">
                        <div class="group-member-count">
                            <i class="fas fa-users"></i>
                            <span>1,254 成员</span>
                        </div>
                        <span>•</span>
                        <span>文化艺术</span>
                    </div>
                </div>
            </a>
            
            <!-- 有图片的卡片式群组 -->
            <a href="#" class="card-group-item">
                <div class="card-group-media">
                    <img src="https://picsum.photos/id/26/400/300" alt="职场交流">
                    <div class="card-group-avatar">
                        <img src="https://picsum.photos/id/26/100/100" alt="职场交流">
                    </div>
                </div>
                <div class="card-group-content">
                    <div class="card-group-name">职场经验交流</div>
                    <div class="card-group-meta">
                        <div class="group-member-count">
                            <i class="fas fa-users"></i>
                            <span>7,321 成员</span>
                        </div>
                        <span>•</span>
                        <span>职场工作</span>
                    </div>
                </div>
            </a>
            
            <!-- 无图片的卡片式群组 -->
            <a href="#" class="card-group-item">
                <div class="card-group-media">
                    <div class="no-image-placeholder">
                        <i class="fas fa-graduation-cap"></i>
                    </div>
                    <div class="card-group-avatar">
                        <i class="fas fa-graduation-cap"></i>
                    </div>
                </div>
                <div class="card-group-content">
                    <div class="card-group-name">考研学习交流</div>
                    <div class="card-group-meta">
                        <div class="group-member-count">
                            <i class="fas fa-users"></i>
                            <span>3,567 成员</span>
                        </div>
                        <span>•</span>
                        <span>学习教育</span>
                    </div>
                </div>
            </a>
        </div>
        
        <!-- 加载更多 -->
        <div class="load-more">
            <button class="load-more-btn" id="loadMoreBtn">
                <i class="fas fa-spinner fa-spin" style="display: none;"></i>
                <span>加载更多</span>
            </button>
        </div>
    </div>
    
    <!-- 创建群组按钮 -->
    <a href="#" class="create-group-btn" id="createGroupBtn">
        <i class="fas fa-plus"></i>
    </a>
    
    <!-- 底部导航 -->
    <div class="bottom-nav">
        <a href="#" class="nav-item">
            <i class="fas fa-home nav-icon"></i>
            <span>首页</span>
        </a>
        <a href="#" class="nav-item">
            <i class="fas fa-compass nav-icon"></i>
            <span>发现</span>
        </a>
        <a href="#" class="nav-item">
            <i class="fas fa-plus-circle nav-icon"></i>
            <span>发布</span>
        </a>
        <a href="#" class="nav-item">
            <i class="fas fa-bell nav-icon"></i>
            <span>通知</span>
        </a>
        <a href="#" class="nav-item active">
            <i class="fas fa-users nav-icon"></i>
            <span>群组</span>
        </a>
    </div>
    
    <!-- 提示消息元素 -->
    <div class="toast" id="toast"></div>
    
    <!-- Bootstrap JS Bundle with Popper -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
    
    <script>
        // DOM元素
        const advancedFilterBtn = document.getElementById('advancedFilterBtn');
        const advancedFilterPanel = document.getElementById('advancedFilterPanel');
        const applyFilterBtn = document.getElementById('applyFilterBtn');
        const resetFilterBtn = document.getElementById('resetFilterBtn');
        const sortSelect = document.getElementById('sortSelect');
        const viewBtns = document.querySelectorAll('.view-btn');
        const listView = document.getElementById('listView');
        const previewView = document.getElementById('previewView');
        const cardView = document.getElementById('cardView');
        const filterBtns = document.querySelectorAll('.filter-btn');
        const filterOptions = document.querySelectorAll('.filter-option');
        const loadMoreBtn = document.getElementById('loadMoreBtn');
        
        // 高级筛选面板切换
        advancedFilterBtn.addEventListener('click', function() {
            if (advancedFilterPanel.style.display === 'none') {
                advancedFilterPanel.style.display = 'block';
                showToast('高级筛选已展开');
            } else {
                advancedFilterPanel.style.display = 'none';
                showToast('高级筛选已收起');
            }
        });
        
        // 筛选选项点击
        filterOptions.forEach(option => {
            option.addEventListener('click', function() {
                // 找到同组的其他选项并移除active类
                const siblings = this.parentElement.querySelectorAll('.filter-option');
                siblings.forEach(sib => sib.classList.remove('active'));
                // 给当前选项添加active类
                this.classList.add('active');
            });
        });
        
        // 应用筛选
        applyFilterBtn.addEventListener('click', function() {
            advancedFilterPanel.style.display = 'none';
            
            // 获取选中的筛选条件
            const category = document.querySelector('.filter-section:nth-child(1) .filter-option.active').textContent;
            const memberCount = document.querySelector('.filter-section:nth-child(2) .filter-option.active').textContent;
            const activity = document.querySelector('.filter-section:nth-child(3) .filter-option.active').textContent;
            
            showToast(`已应用筛选: ${category} · ${memberCount} · ${activity}`);
        });
        
        // 重置筛选
        resetFilterBtn.addEventListener('click', function() {
            // 重置所有筛选选项为"全部"
            document.querySelectorAll('.filter-option').forEach(option => {
                if (option.textContent === '全部') {
                    option.classList.add('active');
                } else {
                    option.classList.remove('active');
                }
            });
        });
        
        // 视图切换
        viewBtns.forEach(btn => {
            btn.addEventListener('click', function() {
                // 移除所有视图按钮的active类
                viewBtns.forEach(b => b.classList.remove('active'));
                // 给当前点击的按钮添加active类
                this.classList.add('active');
                
                // 获取要切换的视图类型
                const viewType = this.getAttribute('data-view');
                
                // 隐藏所有视图
                listView.style.display = 'none';
                previewView.style.display = 'none';
                cardView.style.display = 'none';
                
                // 显示选中的视图
                if (viewType === 'list') {
                    listView.style.display = 'block';
                    showToast('已切换到列表视图');
                } else if (viewType === 'preview') {
                    previewView.style.display = 'block';
                    showToast('已切换到图文视图');
                } else if (viewType === 'card') {
                    cardView.style.display = 'grid';
                    showToast('已切换到卡片视图');
                }
            });
        });
        
        // 快捷筛选按钮
        filterBtns.forEach(btn => {
            btn.addEventListener('click', function() {
                // 移除所有筛选按钮的active类
                filterBtns.forEach(b => b.classList.remove('active'));
                // 给当前点击的按钮添加active类
                this.classList.add('active');
                
                // 显示筛选结果提示
                const filterText = this.querySelector('span').textContent;
                showToast(`已筛选: ${filterText}群组`);
            });
        });
        
        // 排序切换
        sortSelect.addEventListener('change', function() {
            const sortType = this.options[this.selectedIndex].text;
            showToast(`已按${sortType}排序`);
        });
        
        // 加载更多
        loadMoreBtn.addEventListener('click', function() {
            const spinner = this.querySelector('.fa-spinner');
            const text = this.querySelector('span');
            
            // 显示加载状态
            spinner.style.display = 'inline-block';
            text.textContent = '加载中...';
            this.disabled = true;
            
            // 模拟加载延迟
            setTimeout(() => {
                spinner.style.display = 'none';
                text.textContent = '加载更多';
                this.disabled = false;
                showToast('已加载更多群组');
            }, 1500);
        });
        
        // 群组点击事件
        document.querySelectorAll('.list-group-item, .preview-group-item, .card-group-item').forEach(item => {
            item.addEventListener('click', function(e) {
                e.preventDefault();
                let groupName;
                
                if (this.classList.contains('list-group-item')) {
                    groupName = this.querySelector('.group-name').textContent;
                } else if (this.classList.contains('preview-group-item')) {
                    groupName = this.querySelector('.preview-group-name').textContent;
                } else if (this.classList.contains('card-group-item')) {
                    groupName = this.querySelector('.card-group-name').textContent;
                }
                
                showToast(`进入群组：${groupName}`);
            });
        });
        
        // 创建群组按钮
        document.getElementById('createGroupBtn').addEventListener('click', function(e) {
            e.preventDefault();
            showToast('创建新群组');
        });
        
        // 顶部按钮事件
        document.getElementById('backBtn').addEventListener('click', function() {
            history.back();
        });
        
        document.getElementById('groupSettingsBtn').addEventListener('click', function() {
            showToast('群组设置');
        });
        
        // 底部导航点击
        document.querySelectorAll('.nav-item').forEach(item => {
            item.addEventListener('click', function(e) {
                e.preventDefault();
                document.querySelectorAll('.nav-item').forEach(i => i.classList.remove('active'));
                this.classList.add('active');
                const title = this.querySelector('span').textContent;
                showToast(`已切换到${title}`);
            });
        });
        
        // 提示消息功能
        function showToast(message) {
            const toast = document.getElementById('toast');
            toast.textContent = message;
            toast.classList.add('show');
            
            setTimeout(() => {
                toast.classList.remove('show');
            }, 2000);
        }
    </script>
</body>
</html>

